<div class="row">
	<div class="panel callout"><h6>Student Attendance</h6></div>
	<?php 
	if(!empty($student)):
		$this->load->view('profile/_profile_links');
	endif;
	?>
<?php echo form_fieldset('Attendance of ' . strtoupper($student->lastname) . ', ' . ucfirst($student->firstname));?>

	<table class="data-table">
			<thead class="tabular-head">
			<tr>
				<th>Month</th>
				<th>Present</th>
				<th>Absent</th>
				<th>Tardy</th>
				<th>Cut Class</th>
			</tr>
			</thead>
			<tbody class="tabular">
		<? if(!empty($student_att)) :?>
			<? foreach($student_att as $row) : ?>
			    <tr>
				    <?if(isset($per_month)) :?>
						<td><?=date('F d, Y', strtotime($row->att_date)); ?></td>
					<?else:?>
						<td><a href="<?=site_url(array('profile','student_attendance',$student->enrollment_id,date('m-Y', strtotime($row->att_date))));?>"><?= date('F, Y', strtotime($row->att_date))?></a></td>
					<?endif;?>
				    <td><?= $row->p ?></td>
					<td><?= $row->a ?></td>
					<td><?= $row->t ?></td>
					<td><?= $row->c ?></td>
			    </tr>
			<? endforeach ;?>
				<?if(!empty($student_totals)) :?>
					<?foreach($student_totals as $totals) :?>
						<tr>
							<td>TOTALS: </td>
							<td><?= $totals->p ?></td>
							<td><?= $totals->a ?></td>
							<td><?= $totals->t ?></td>
							<td><?= $totals->c ?></td>
						</tr>
					<?endforeach;?>
				<?else:?>
					<tr>
						<td>Error retireving totals</td>
					</tr>
				<?endif;?>
		<? else: ?>
			    <tr>
				    <th colspan=10 align=center>-- No Attendance --</th>
			    </tr>
		<? endif;?>
      </tbody>
  </table>
<?php echo form_fieldset_close();?>

</div>